package com.joysuch.wwyt.workflow.service.impl;

import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.joysuch.wwyt.core.support.Context;
import com.joysuch.wwyt.workflow.entity.WorkflowTaskExportTemplate;
import com.joysuch.wwyt.workflow.mapper.WorkflowTaskExportTemplateMapper;
import com.joysuch.wwyt.workflow.service.WorkflowTaskExportTemplateService;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * <p>
 *  服务实现类
 * </p>
 *
 * @author jwk
 * @since 2021-07-23
 */
@Service
public class WorkflowTaskExportTemplateServiceImpl extends ServiceImpl<WorkflowTaskExportTemplateMapper, WorkflowTaskExportTemplate> implements WorkflowTaskExportTemplateService {

    @Override
    public List<WorkflowTaskExportTemplate> findList(Long processId) {
        LambdaQueryWrapper<WorkflowTaskExportTemplate> wrapper = new LambdaQueryWrapper<>();
        wrapper.eq(WorkflowTaskExportTemplate::getDeleteFlag, "0");
        wrapper.eq(WorkflowTaskExportTemplate::getProcessId, processId);
        wrapper.eq(WorkflowTaskExportTemplate::getTenentId, Context.getCurrentTenantId());
        wrapper.likeRight(WorkflowTaskExportTemplate::getOrgCode, Context.getCompanyCode());
        return super.list(wrapper);
    }
}
